package com.cwvs.services;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cwvs.dao.AppNeedOrderDao;
import com.cwvs.utils.Pages;

@Service
public class AppNeedOrderService {
	@Resource
	private AppNeedOrderDao appNeedOrderDao;
	/**
	 * 新增需求
	 * 
	 * @param m
	 * @return
	 */
	public String add(Map<String, Object> m) {
		return appNeedOrderDao.add(m);
	}
	/**
	 * 审核需求
	 * 
	 * @param m
	 * @return
	 */
	public boolean approve(Map<String, Object> m) {
		return appNeedOrderDao.approve(m);
	}
	
	/**
	 * 取消/完成需求
	 * 
	 * @param m
	 * @return
	 */
	public boolean cancelOrDone(Map<String, Object> m) {
		return appNeedOrderDao.cancelOrDone(m);
	}
	
	/**
	 * 通过ID获取需求信息
	 * 
	 * @param m
	 * @return
	 */
	public Map<String, Object> getInfoById(Map<String, Object> m) {
		return appNeedOrderDao.getInfoById(m);
	}
	
	/**
	 * 判断用户是否已经接过此需求
	 * @return
	 */
	public boolean isExists(Map<String,Object> m){
		return appNeedOrderDao.isExists(m);
	}
	/**
	 * 保存揭榜信息
	 */
	public boolean saveAcceptInfo(Map<String,Object> m){
		return appNeedOrderDao.saveAcceptInfo(m);
	}
	/**
	 * 需求列表
	 * 
	 * @return
	 */
	public Pages needList(Map<String, Object> m, Pages page) {
		return appNeedOrderDao.needList(m, page);
	}
	/**
	 * 揭榜列表
	 * 
	 * @return
	 */
	public Pages acceptList(Map<String, Object> m, Pages page) {
		return appNeedOrderDao.acceptList(m, page);
	}
	/**
	 * 回写订单支付charge
	 */
	public void updateOrderCharge(String orderId, String chargeId) {
		appNeedOrderDao.updateOrderCharge(orderId, chargeId);
	}
	/**
	 * 通过ID获取支付CHARGE_ID
	 * 
	 * @param m
	 * @return
	 */
	public Map<String, Object> getChargeById(Map<String, Object> m) {
		return appNeedOrderDao.getChargeById(m);
	}
	
	
	/**
	 * 揭榜
	 */
	public void updateAcceptStatus(Map<String,Object> m){
		appNeedOrderDao.updateAcceptStatus(m);
	}
	/**
	 * 通过ID获取揭榜信息
	 */
	public Map<String, Object> getAcceptOrderById(Map<String, Object> m) {
		return appNeedOrderDao.getAcceptOrderById(m);
	}
}
